/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package smartgrid;

import java.util.List;
import org.hibernate.criterion.DetachedCriteria;
import org.orm.PersistentSession;
import org.orm.criteria.*;

public class SupplierDetachedCriteria extends AbstractORMDetachedCriteria {
	public final IntegerExpression ID;
	public final StringExpression Name;
	public final StringExpression Country;
	
	public SupplierDetachedCriteria() {
		super(smartgrid.Supplier.class, smartgrid.SupplierCriteria.class);
		ID = new IntegerExpression("ID", this.getDetachedCriteria());
		Name = new StringExpression("Name", this.getDetachedCriteria());
		Country = new StringExpression("Country", this.getDetachedCriteria());
	}
	
	public SupplierDetachedCriteria(DetachedCriteria aDetachedCriteria) {
		super(aDetachedCriteria, smartgrid.SupplierCriteria.class);
		ID = new IntegerExpression("ID", this.getDetachedCriteria());
		Name = new StringExpression("Name", this.getDetachedCriteria());
		Country = new StringExpression("Country", this.getDetachedCriteria());
	}
	
	public TariffDetachedCriteria createTariff_Tariff_roleCriteria() {
		return new TariffDetachedCriteria(createCriteria("ORM_Tariff_Tariff_role"));
	}
	
	public Supplier uniqueSupplier(PersistentSession session) {
		return (Supplier) super.createExecutableCriteria(session).uniqueResult();
	}
	
	public Supplier[] listSupplier(PersistentSession session) {
		List list = super.createExecutableCriteria(session).list();
		return (Supplier[]) list.toArray(new Supplier[list.size()]);
	}
}

